<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

Route::group('api', function () {
    ################################## 首页 #######################################
    //轮播图
    Route::get('banners', 'api/index/banner');
    //基本信息
    Route::get('infos', 'api/index/info');

    ################################## 个人中心 ####################################
    //用户优惠券
    Route::get('users/coupons', 'api/order/userCoupon');
    //我的收藏
    Route::get('users/likes', 'api/user/like');
    //授权
    Route::post('auth', 'api/user/auth');
    //更新用户头像昵称
    Route::post('users', 'api/user/update');
    //用户信息get
    Route::get('users', 'api/user/info');
    //获取小程序码
    Route::post('codes', 'api/user/code');
    //关于拾玖
    Route::get('about', 'api/user/about');
    //联系客服
    Route::get('services', 'api/user/service');
    //解密数据
    Route::post('decrypt', 'api/user/decryptData');

    ################################# 拾玖圈 #######################################
    //造型师作品集
    Route::get('circles/designs/:design_id', 'api/circle/design');
    //拾玖圈点赞
    Route::get('circles/:circle_id/likes', 'api/circle/like');
    //评论
    Route::post('circles/:circle_id/comments', 'api/circle/comment');
    //回复
    Route::post('comments/:comment_id/replies', 'api/circle/reply');
    //拾玖圈评论
    Route::get('circles/:circle_id/comments', 'api/circle/getComment');

    Route::get('circles/categories', 'api/circle/category');
    //拾玖圈详情
    Route::get('circles/:circle_id', 'api/circle/read');
    //拾玖圈
    Route::get('circles', 'api/circle/index');

    ################################## 造型师 ##########################################
    //预约选择页面
    Route::get('designs/:design_id/subscribe', 'api/design/selectSubscribe');
    //造型师预约情况
    Route::get('designs/:design_id/busy', 'api/design/busy');
    //造型师预约列表
    Route::get('designs/:design_id/orders', 'api/design/orders');
    //造型师分类
    Route::get('designs/categories', 'api/design/category');
    //造型师详情
    Route::get('designs/:design_id', 'api/design/read');
    //首页造型师
    Route::get('designs', 'api/design/index');
    //造型师注册
    Route::post('designs', 'api/design/create');

    ################################## 订单 ##########################################
    //确认预约页面
    Route::post('orders/subscribe/confirm', 'api/order/confirmSubscribe');
    //立即预约
    Route::post('orders/subscribe', 'api/order/subscribe');
    //微信支付
    Route::post('orders/payment', 'api/order/payment');
    //支付回调
    Route::post('orders/notifying', 'api/order/notify');
    //取消订单
    Route::post('orders/:order_id/cancel', 'api/order/cancel');
    //支付结果通知
    Route::post('payment/notify', 'api/order/paymentResult');
    //取消申请
    Route::get('orders/:order_id/repeal', 'api/order/repeal');
    //确认完成
    Route::get('orders/:order_id/finish', 'api/order/finish');
    //确认服务
    Route::get('orders/:order_id/service', 'api/order/inService');
    //服务评价
    Route::post('orders/:order_id/comment', 'api/order/comment');
    //修改预约时间
    Route::post('orders/:order_id/time', 'api/order/time');
    //订单详情
    Route::get('orders/:order_id', 'api/order/read');
    //订单列表
    Route::get('orders', 'api/order/index');
    //发送订阅消息
    Route::post('messages/subscribe', 'api/order/send');
    ################################ 充值 #########################################
    //充值
    Route::post('recharges/:recharge_id/pay', 'api/recharge/pay');
    //充值结果
    Route::post('recharges/payment', 'api/recharge/paymentResult');
    //回调
    Route::post('recharges/notifying', 'api/recharge/notify');
    //充值记录
    Route::get('recharges/record', 'api/recharge/record');
    //充值套餐
    Route::get('recharges', 'api/recharge/index');

    ################################ 会员 ####################################
    //支付
    Route::post('vips/:vip_id/pay', 'api/vip/pay');
    //支付结果
    Route::post('vips/payment', 'api/vip/paymentResult');
    //回调
    Route::post('vips/notifying', 'api/vip/notify');
    //会员等级
    Route::get('vips', 'api/vip/index');

    ############################### 优惠券 ##################################
    //优惠券分类
    Route::get("coupons/categories", 'api/coupon/category');
    //领取优惠券
//    Route::get('coupons/:coupon_id/user', 'api/index/getCoupon');
    //优惠券分享
    Route::get('coupons/share', 'api/coupon/share');
    //优惠券详情
    Route::get('coupons/:coupon_id', 'api/coupon/read');
    //优惠券
    Route::get('coupons', 'api/coupon/index');
    //支付
    Route::post('coupons/:coupon_id/pay', 'api/coupon/pay');
    //支付结果
    Route::post('coupons/payment', 'api/coupon/paymentResult');
    //回调
    Route::post('coupons/notifying', 'api/coupon/notify');

    ####################################### 用户优惠券 ##############################################
    //核销优惠券
    Route::post('user-coupons/check', 'api/userCoupon/check');
    //优惠券详情
    Route::post('user-coupons/code', 'api/userCoupon/readCode');
    Route::get('user-coupons/:user_coupon_id', 'api/userCoupon/read');

    ####################################### 用户到店订单 ##############################################
    //支付
    Route::post('real-orders/:order_id/pay', 'api/realOrder/pay');
    //支付结果
    Route::post('real-orders/payment', 'api/realOrder/paymentResult');
    //回调
    Route::post('real-orders/notifying', 'api/realOrder/notify');
    //订单支付信息
    Route::get('real-orders/:order_id/info', 'api/realOrder/info');

    ##################################### 用户自主买单 ##################################################
    //全部服务
    Route::get("modeling", "api/userPayment/modeling");
    //买单回调
    Route::post("user-payment/notify/result", "api/userPayment/paymentResult");
    Route::post("user-payment/notify", "api/userPayment/notify");
    //用户买单记录
    Route::get("user-payment/log", "api/user/paymentLog");
    //买单
    Route::post("user-payment", "api/userPayment/payment");

});
